public class JniTest {
    static {
        // System.loadLibrary("hello");
        System.loadLibrary("resource-demo");
    }

    public static void main(String[] args) throws Exception {
        // HelloWorld hw = new HelloWorld();
    	// while (true) {
    	//     System.out.println(hw.sayHelloWorld());
    	//     Thread.currentThread().sleep(10*1000);
    	// }
        ResourceDemo resource = new ResourceDemo();
        resource.eatMemory(20);
        System.out.println("allocate memory 20MB");
        // resource.eatCpu();
        for (int i = 0; i < 6; i++) {
            Thread.currentThread().sleep(10*1000);
        }
    }
}
